if (hrm == null)
	var hrm = {};
if (hrm.common == null)
	hrm.common = {};
if (HRMCommon == null)
	var HRMCommon = hrm.common;
hrm.common._navigatorIE = "MSIE";
hrm.common._navigatorFF = "Firefox";
hrm.common._histotyIdSuffix = "HiddenForHistory";
hrm.common._imgPath = "resource/images/";
hrm.common.isNotEmpty = function($) {
	if ($ == null)
		return false;
	if (typeof $ == "string" && $.length == 0)
		return false;
	return true
};
hrm.common.isEmpty = function($) {
	if ($ == null)
		return true;
	if (typeof $ == "string" && $.length == 0)
		return true;
	return false
};
hrm.common.getActiveFields = function(_) {
	var A = new Array();
	for ( var $ in _)
		if (_[$] != null && typeof _[$] != "function")
			A[A.length] = $ + ":" + _[$];
	return A
};
hrm.common.isNumber = function($) {
	if ($ == null || $.trim().length <= 0)
		return false;
	var _ = new RegExp("^\\d+$");
	return _.test($)
};
hrm.common.isPhone = function($) {
	if ($ == null)
		return false;
	var _ = new RegExp("^([-0|1|2|3|4|5|6|7|8|9|+|.|#|*|(|)]){7,}$");
	return _.test($)
};
hrm.common.isMobile = function($) {
	if ($ == null || $.trim().length <= 0 || !hrm.common.isNumber($))
		return false;
	if ($.indexOf("0") == 0)
		return true;
	if ($.charAt(0) != 1)
		return false;
	var _ = new RegExp("^(13[0-9]|15[0|3|6|7|8|9]|18[7|8|9])\\d{8}$");
	return _.test($)
};
hrm.common.showDebugError = function($) {
	document.body.innerHTML = "<h3>" + $ + "</h3><br/>"
			+ document.body.innerHTML
};
hrm.common.actionMsgHandler = function(_) {
	var $ = _.indexOf(":");
	if ($ == -1 || $ > 16) {
		errMsg("errMsg", _);
		return "UNDEFINED"
	}
	if (_.indexOf("SUCC:") == 0) {
		successMsg("errMsg", _.substring($ + 1));
		return "SUCC"
	} else {
		errMsg("errMsg", _.substring($ + 1));
		return _.substring(0, $)
	}
};
hrm.common.alertMsgHandler = function(_) {
	var $ = _.indexOf(":");
	if ($ == -1 || $ > 16) {
		alert(_);
		return "UNDEFINED"
	}
	if (_.indexOf("SUCC:") == 0)
		return "SUCC";
	else if (_.indexOf("CONFIRM:") == 0) {
		if (confirm(_.substring($ + 1)))
			return "CONFIRM_TRUE";
		else
			return "CONFIRM_FALSE"
	} else {
		alert(_.substring($ + 1));
		return _.substring(0, $)
	}
};
hrm.common.comboMsgHandler = function(_) {
	var $ = _.indexOf(":");
	if ($ == -1 || $ > 16) {
		alert(_);
		return "UNDEFINED"
	}
	if (_.indexOf("SUCC:") == 0) {
		successMsg("errMsg", _.substring($ + 1));
		return "SUCC"
	} else if (_.indexOf("CONFIRM:") == 0) {
		if (confirm(_.substring($ + 1)))
			return "CONFIRM_TRUE";
		else
			return "CONFIRM_FALSE"
	} else {
		alert(_.substring($ + 1));
		return _.substring(0, $)
	}
};
hrm.common.getNavigatorType = function() {
	var $ = navigator.userAgent, A = {};
	A.name = hrm.common._navigatorIE;
	var _ = $.indexOf(A.name);
	if (_ == -1) {
		A.name = hrm.common._navigatorFF;
		_ = $.indexOf(A.name)
	}
	if (_ == -1) {
		A.name = "unknown";
		return A
	}
	$ = $.substring(_ + A.name.length + 1);
	_ = $.indexOf(" ");
	if (_ > -1)
		$ = $.substring(0, _);
	A.version = $;
	return A
};
hrm.common.navigatorIsIE = function() {
	if (hrm.common.getNavigatorType().name == hrm.common._navigatorIE)
		return true;
	return false
};
hrm.common.navigatorIsFF = function() {
	if (hrm.common.getNavigatorType().name == hrm.common._navigatorFF)
		return true;
	return false
};
hrm.common.getCookie = function(B) {
	if (typeof B != "string" || B.length == 0) {
		hrm.common
				.showDebugError("\u53c2\u6570\u5fc5\u987b\u4e3astring\u7c7b\u578b\uff0chrm.common.getCookie");
		return null
	}
	var $ = document.cookie, _ = $.indexOf(B + "=");
	if (_ == -1)
		return null;
	_ += B.length + 1;
	var A = $.indexOf(";", _);
	if (A == -1)
		A = $.length;
	return unescape($.substring(_, A))
};
hrm.common.setCookie = function(B, _) {
	var $ = B + "=" + escape(_), A = arguments.length;
	if (hrm.common.isNotEmpty(arguments[2])) {
		var C = new Date();
		C.setTime(C.getTime() + arguments[2] * 1000 * 60 * 60 * 24);
		$ += ";expires=" + C.toGMTString()
	}
	if (hrm.common.isNotEmpty(arguments[3]))
		$ += ";path=" + arguments[3];
	if (hrm.common.isNotEmpty(arguments[4]))
		$ += ";domain=" + arguments[4];
	if (hrm.common.isNotEmpty(arguments[5]))
		$ += ";secure=" + arguments[5];
	document.cookie = $
};
hrm.common.initDialog = function(_) {
	var A = $("#" + _).width();
	if (hrm.common.isNotEmpty(arguments[1])
			&& (width1 = parseInt(arguments[1])) > 0)
		A = width1;
	if (A == 0) {
		hrm.common
				.showDebugError("id\u4e3a\u201c"
						+ _
						+ "\u201d\u7684\u5143\u7d20\u65e0\u6cd5\u5f97\u5230\u5bbd\u5ea6\uff0c\u53ea\u80fd\u8bbe\u4e3aauto");// 的元素无法得到宽度，只能设为auto

		A = "auto"
	}
	$( function() {
		$("#" + _).dialog( {
			bgiframe :true,
			autoOpen :false,
			resizable :false,
			width :A,
			height :"auto",
			modal :true
		})
	})
};
hrm.common.openDialog = function(A) {
	var B = $("#" + A);
	if (arguments[2] != null)
		B.dialog("option", "title", arguments[2]);
	B.css("border", "1px #6BB5DA solid");
	B.dialog("open");
	var _ = $(B.get(0).offsetParent);
	if (_.find("iframe").size() == 0) {
		var C = "<iframe scrolling=\"no\" frameborder=\"0\" style=\"position:absolute;z-index:-1;top:0px;left:0px;width:"
				+ _.innerWidth() + "px;height:" + _.innerHeight() + "px;\"/>";
		_.append(C)
	}
	if (arguments[1] == null)
		return;
	$("#" + arguments[1]).append(_)
};
hrm.common.closeDialog = function(_) {
	$("#" + _).dialog("close")
};
hrm.common.getKeyCode = function($) {
	return $.keyCode ? $.keyCode : $.which
};
hrm.common.keyCodeIsInput = function($) {
	if ($ == 32 || ($ >= 48 && $ <= 90) || ($ >= 95 && $ <= 122)
			|| ($ >= 185 && $ <= 222))
		return true;
	return false
};
hrm.common.keyCodeIsNumber = function($) {
	if (($ >= 48 && $ <= 57) || ($ >= 95 && $ <= 105))
		return true;
	var D = new Array(new Array(110, 190), new Array(109, 189), new Array(32,
			188)), A = arguments.length, C = 1;
	for ( var _ = C; _ < A; _++)
		if (arguments[_])
			for ( var B = 0; B < D[_ - C].length; B++)
				if (D[_ - C][B] == $)
					return true;
	return false
};
hrm.common.isHrmNumber = function(A) {
	if (typeof A != "string")
		return false;
	A = A.trim();
	if (arguments[3] != null && arguments[3]) {
		var _ = new RegExp("[, ]", "gi");
		A = A.replace(_, "")
	}
	var $ = parseFloat(A);
	if ($ != A)
		return false;
	if (arguments[1] != null && !arguments[1] && $ < 0)
		return false;
	if (arguments[2] != null && !arguments[2] && A.indexOf(".") > -1)
		return false;
	return true
};
hrm.common.checkOnKeyDownFloat = function($, A) {
	var _ = hrm.common.getKeyCode($);
	if (A.value.length == 0) {
		if (_ == 45 || (_ >= 48 && _ <= 57) || _ == 9)
			return;
		if (hrm.common.getNavigatorType().name == hrm.common._navigatorIE)
			$.returnValue = false;
		else
			$.preventDefault()
	}
	if ((_ >= 48 && _ <= 57) || _ == 46 || _ == 8 || _ == 99 || _ == 118)
		return;
	if (!(_ >= 33 && _ <= 36) && !(_ >= 40 && _ <= 44) && !(_ >= 91 && _ <= 94)
			&& _ != 47 && !hrm.common.keyCodeIsInput(_))
		return;
	if (_ != 46 || !(_ > 48 && _ < 57))
		if (hrm.common.getNavigatorType().name == hrm.common._navigatorIE)
			$.returnValue = false;
		else
			$.preventDefault()
};
hrm.common.checkOnKeyUpFloat = function($, A) {
	var _ = hrm.common.getKeyCode($);
	if (!hrm.common.keyCodeIsInput(_))
		return;
	if (hrm.common.isHrmNumber(A.value, true, true)) {
		hrm.common.setHistoryValue(A.id, A.value);
		return
	}
	A.value = hrm.common.getHistoryValue(A.id)
};
hrm.common.setHistoryValue = function(B, _) {
	B += hrm.common._histotyIdSuffix;
	var A = $("#" + B);
	if (A.size() == 0) {
		$("body").append(
				"<input type=\"hidden\" id=\"" + B + "\" value=\"" + _ + "\">");
		return
	}
	A.val(_)
};
hrm.common.getHistoryValue = function(A) {
	A += hrm.common._histotyIdSuffix;
	var _ = $("#" + A);
	if (_.size() == 0) {
		$("body").append("<input type=\"hidden\" id=\"" + A + "\" value=\"\">");
		return ""
	}
	return _.val()
};
hrm.common.checkPositive = function($) {
	var _ = hrm.common.getKeyCode($);
	if (!hrm.common.keyCodeIsInput(_))
		return;
	if (hrm.common.keyCodeIsNumber(_, false, false))
		return;
	if (hrm.common.getNavigatorType().name == hrm.common._navigatorIE)
		$.returnValue = false;
	else
		$.preventDefault()
};
hrm.common.MKeyTextLength = function(A, $) {
	var _ = A.value.length;
	if (_ < $) {
		hrm.common.setHistoryValue(A.id, A.value);
		return
	}
	A.value = hrm.common.getHistoryValue(A.id)
};
hrm.common.checkFloatAndFormat = function(E, _, D) {
	if (E.value.trim() == "" && D != true)
		return;
	var C = new RegExp("^(\\-)?\\d{1,}(\\.\\d{1,})?$"), F = new RegExp(
			"^(\\-)?(\\.\\d{1,})?$"), B = new RegExp("^(\\-)?\\d{1,}\\.$");
	if (!C.test(E.value) && !F.test(E.value) && !B.test(E.value)) {
		E.style.border = "1px #FF0000 solid";
		alert("\u8f93\u5165\u7684\u6570\u5b57\u683c\u5f0f\u9519\u8bef\uff0c\u6b63\u786e\u683c\u5f0f\u4e3a\uff1a8.88\u6216-8.88\u6216.88\u6216-.88");
		return
	}
	E.style.border = "1px solid #6BB5DA";
	if (E.value.trim() == "")
		E.value = 0;
	else if (E.value.length == 1 && E.value == "-")
		E.value += "0";
	var $ = E.value.indexOf(".");
	if ($ == -1 && _ != 0)
		E.value += ".";
	else if ($ == 0)
		E.value = "0" + E.value;
	else if ($ == 1 && E.value.charAt(0) == "-")
		E.value = E.value.charAt(0) + "0"
				+ E.value.substring(1, E.value.length);
	$ = E.value.indexOf(".");
	if (_ == null || _ == 2) {
		var A = E.value.substring($ + 1, E.value.length);
		if (A.length == 1)
			E.value += "0";
		else if (A.length == 0)
			E.value += "00"
	} else if (_ == 3) {
		A = E.value.substring($ + 1, E.value.length);
		if (A.length == 1)
			E.value = E.value + "00";
		else if (A.length == 2)
			E.value = E.value + "0";
		else if (A.length == 0)
			E.value += "000"
	} else if (_ == 1) {
		A = E.value.substring($ + 1, E.value.length);
		if (A.length == 0)
			E.value += "0"
	}
};
hrm.common.checkFormat = function(G, _, D) {
	var F = document.getElementById(G.id + "FormatInfo");
	if (G.value.trim() == "" && (D == null || D == true)) {
		if (F != null)
			G.parentNode.removeChild(document.getElementById(G.id
					+ "FormatInfo"));
		return
	}
	var E = new RegExp("^(\\-)?\\d{1,}(\\.\\d{1,})?$"), H = new RegExp(
			"^(\\-)?(\\.\\d{1,})?$"), C = new RegExp("^(\\-)?\\d{1,}\\.$");
	if (!E.test(G.value) && !H.test(G.value) && !C.test(G.value)) {
		if (F == null) {
			var B = document.createElement("label");
			B.id = G.id + "FormatInfo";
			B.style.color = "red";
			B.innerHTML = "\u683c\u5f0f\u9519\u8bef\uff01";
			G.parentNode.appendChild(B)
		} else
			F.innerHTML = "\u683c\u5f0f\u9519\u8bef\uff01";
		return
	}
	if (F != null)
		G.parentNode.removeChild(document.getElementById(G.id + "FormatInfo"));
	if (G.value.trim() == "")
		G.value = 0;
	else if (G.value.length == 1 && G.value == "-")
		G.value += "0";
	var $ = G.value.indexOf(".");
	if ($ == -1)
		G.value += ".";
	else if ($ == 0)
		G.value = "0" + G.value;
	else if ($ == 1 && G.value.charAt(0) == "-")
		G.value = G.value.charAt(0) + "0"
				+ G.value.substring(1, G.value.length);
	$ = G.value.indexOf(".");
	if (_ == null || _ == 2) {
		var A = G.value.substring($ + 1, G.value.length);
		if (A.length == 1)
			G.value += "0";
		else if (A.length == 0)
			G.value += "00"
	} else if (_ == 3) {
		A = G.value.substring($ + 1, G.value.length);
		if (A.length == 1)
			G.value = G.value + "00";
		else if (A.length == 2)
			G.value = G.value + "0";
		else if (A.length == 0)
			G.value += "000"
	} else if (_ == 1) {
		A = G.value.substring($ + 1, G.value.length);
		if (A.length == 0)
			G.value += "0"
	}
};
hrm.common.checkFloat = function($) {
	if (hrm.common.isNull($))
		return true;
	var _ = new RegExp("^(\\-)?\\d{1,}(\\.\\d{1,})?$");
	return _.test($)
};
Date.prototype.toFormatString = function(A) {
	var $ = {
		"M+" :"0" + (this.getMonth() + 1),
		"d+" :"0" + this.getDate(),
		"h+" :"0" + this.getHours(),
		"m+" :"0" + this.getMinutes(),
		"s+" :"0" + this.getSeconds(),
		"q+" :"0" + Math.floor((this.getMonth() + 3) / 3),
		"S" :"00" + this.getMilliseconds()
	};
	if (/(y+)/.test(A))
		A = A.replace(RegExp.$1, (this.getFullYear() + "")
				.substr(4 - RegExp.$1.length));
	for ( var _ in $)
		if (new RegExp("(" + _ + ")").test(A))
			A = A.replace(RegExp.$1, RegExp.$1.length == 1 ? $[_]
					: ("00" + $[_]).substr(("" + $[_]).length));
	return A
};
Date.prototype.toHRMDateString = function() {
	return this.toFormatString("yyyy-MM-dd")
};
Date.prototype.toHRMTimeString = function() {
	return this.toFormatString("yyyy-MM-dd hh:mm:ss")
};
hrm.common.isDate = function(D) {
	var C = /^(\d{4})-(\d{1,2})-(\d{1,2})|(\d{4})-(\d{1,2})$/;
	if (C.test(D)) {
		var B = D.split("-"), A = parseInt(B[0]);
		if (isNaN(A) || (A > 9999) || (A < 100))
			return false;
		var $ = parseInt(B[1], 10);
		if (isNaN($) || ($ > 12) || ($ < 1))
			return false;
		if (B.length == 3) {
			var _ = parseInt(B[2], 10);
			if (isNaN(_) || (_ > 31) || (_ < 1))
				return false;
			switch ($) {
			case 2:
				if (_ > 29)
					return false;
				if (A % 4 != 0 || (A % 100 == 0) && (A % 400 != 0))
					if (_ > 28)
						return false;
			case 4:
			case 6:
			case 9:
			case 11:
				if (_ > 30)
					return false
			}
		}
		return true
	}
	return false
};
hrm.common.isYM = function(C) {
	var B = /^(\d{4})-(\d{1,2})$/, _, $;
	if (B.test(C)) {
		var A = C.split("-");
		_ = parseInt(A[0]);
		if (isNaN(_) || (_ > 9999) || (_ < 100))
			return false;
		$ = parseInt(A[1], 10);
		if (isNaN($) || ($ > 12) || ($ < 1))
			return false
	} else {
		_ = parseInt(C.substring(0, 4));
		$ = parseInt(C.substring(4, 6), 10)
	}
	if (isNaN(_) || (_ > 9999) || (_ < 100))
		return false;
	if (isNaN($) || ($ > 12) || ($ < 1))
		return false;
	return true
};
hrm.common.isHms = function(A, _) {
	var $ = /^(0\d{1}|1\d{1}|2[0-3]):[0-5]\d{1}:([0-5]\d{1})$/;
	if ($.test(_)) {
		A.style.border = "1px #6BB5DA solid";
		return true
	} else {
		alert("\u65f6\u95f4"
				+ _
				+ "\u8f93\u5165\u4e0d\u6b63\u786e\uff0c\u683c\u5f0f\u5e94\u598210:10:10\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff01");
		A.style.border = "1px #FF0000 solid";
		A.focus();
		return false
	}
};
String.prototype.trim = function() {
	return this.replace(/(^\s*)|(\s*$)/g, "")
};
hrm.common.clearAllFormValue = function(_) {
	var A = $("#" + _);
	A.find(":text").val("");
	A.find("select").val("")
};
hrm.common.check_showHide = function() {
	if (!hrm.common.getCookie("showBasic"))
		hrm.common.setCookie("showBasic", "true", 30, "/");
	var $ = hrm.common.getCookie("showBasic");
	if ($ != "true")
		hrm.common.searchTypeChange()
};
hrm.common.searchTypeChange = function() {
	var B = document.getElementById("basic"), A = document.getElementById("t1"), _ = document
			.getElementById("advanced"), $ = document.getElementById("t2");
	if (B.style.display != "none") {
		hrm.common.setCookie("showBasic", "false", 30, "/");
		B.style.display = "none";
		A.style.display = "none";
		_.style.display = "block";
		$.style.display = "block"
	} else {
		hrm.common.setCookie("showBasic", "true", 30, "/");
		B.style.display = "block";
		A.style.display = "block";
		_.style.display = "none";
		$.style.display = "none"
	}
};
hrm.common.submitForm = function(_) {
	var B = arguments.length;
	if (B % 2 == 1)
		return;
	for ( var A = 2; A < B; A += 2)
		$("#" + arguments[A]).val(arguments[A + 1]);
	var C = $("#" + _).get(0);
	if (hrm.common.isNotEmpty(arguments[1]))
		C.action = arguments[1];
	C.submit()
};
hrm.common.check_order = function() {
	var A = document.getElementById("order").value, _ = A.split("-");
	if (_[0] != null && _.length == 2) {
		var $ = document.getElementById(_[0] + "_img");
		if (_[1] == "up")
			$.setAttribute("src", "../resource/images/arrow_up.gif");
		else
			$.setAttribute("src", "../resource/images/arrow_down.gif")
	}
};
hrm.common.order_submit = function(C, A, B) {
	var _ = document.getElementById("order"), $ = document.getElementById(C
			+ "_img").src, D = $.substring($.lastIndexOf("/"), $.length);
	if (B == null || B.trim() == "") {
		if (D.lastIndexOf("up") != -1)
			_.value = C + "-down";
		else
			_.value = C + "-up"
	} else {
		if (D.lastIndexOf(B) != -1)
			if (B == "up")
				B = "down";
			else
				B = "up";
		_.value = C + "-" + B
	}
	try {
		hrm.common.search_check("basic", "advanced")
	} catch (E) {
	}
	if (HRMCommon.isNotEmpty(A))
		document.getElementById(A).submit();
	else
		document.forms[0].submit()
};
hrm.common.search_check = function(_, B) {
	if (document.getElementById("searchOrExport") != null)
		document.getElementById("searchOrExport").value = "";
	var A = document.getElementById(_), $ = document.getElementById(B);
	if (A == null || A == undefined || $ == null || $ == undefined)
		return;
	if (!hrm.common.getCookie("showBasic")) {
		$.innerHTML = "";
		return
	}
	var C = hrm.common.getCookie("showBasic");
	if (C != "true")
		A.innerHTML = "";
	else
		$.innerHTML = "";
	return
};
hrm.common.export_check = function($) {
	if ($)
		document.getElementById("searchOrExport").value = $;
	document.forms[0].submit();
	document.getElementById("searchOrExport").value = "";
	return
};
if (window.addEventListener)
	FixPrototypeForGecko();
function FixPrototypeForGecko() {
	HTMLElement.prototype.__defineGetter__("runtimeStyle",
			element_prototype_get_runtimeStyle);
	window.constructor.prototype.__defineGetter__("event",
			window_prototype_get_event);
	Event.prototype.__defineGetter__("srcElement",
			event_prototype_get_srcElement)
}
function element_prototype_get_runtimeStyle() {
	return this.style
}
function window_prototype_get_event() {
	return getEvent()
}
function event_prototype_get_srcElement() {
	return this.target
}
function getEvent() {
	if (document.all)
		return window.event;
	func = getEvent.caller;
	while (func != null) {
		var $ = func.arguments[0];
		if ($)
			if (($.constructor == Event || $.constructor == MouseEvent)
					|| (typeof ($) == "object" && $.preventDefault && $.stopPropagation))
				return $;
		func = func.caller
	}
	return null
}
hrm.common.logTrHtml = function() {
	return "<tr>"
			+ "<td align=\"center\" id=\"item_<n>-slChangeEmpno-empName\"></td>"
			+ "<td align=\"center\" id=\"item_<n>-slChangeTime\"></td>"
			+ "<td align=\"center\" id=\"item_<n>-slAction\"></td>"
			+ "<td align=\"center\" id=\"item_<n>-slComments\"></td>" + "</tr>"
};
hrm.common.LogShowDiv = function(_, A, C) {
	ReadLog.getLogs(_, A, B);
	function B(J) {
		var B = "logTable";
		if (model.simple.getObjectType(J) == "Array" && J.length > 0) {
			for ( var F = 0; F < J.length; F++)
				J[F]["slChangeTime"] = J[F]["slChangeTime"]
						.format("yyyy-MM-dd hh:mm:ss");
			model.simple.initTableByList(B, "item", J, hrm.common.logTrHtml())
		} else {
			var _ = $("#" + B);
			_.find("tr:gt(0)").remove();
			_
					.append("<tr><td align=\"center\" colspan=\"4\">\u6ca1\u6709\u6b64\u6761\u8bb0\u5f55\u76f8\u5173\u4fe1\u606f</td></tr>")
		}
		var A = model.simple.getElementPosition(C), L = A.left, K = A.top, H = $("#log1"), I = H
				.width(), E = H.height(), D = L - I - 10, G = K;
		H.css("left", D + "px");
		H.css("top", G + "px");
		H.show()
	}
};
hrm.common.getCursorPos = function($) {
	var A = document.selection.createRange(), B = $.createTextRange(), _ = A
			.getBookmark();
	B.collapse();
	B.moveToBookmark(_);
	B.moveStart("character", -$.value.length);
	str = B.text.replace(/\r\n/g, "");
	return (str.length)
};
hrm.common.setCursorPos = function($, A) {
	var _ = $.createTextRange();
	_.moveStart("character", A - 0);
	_.collapse(true);
	_.select()
};
hrm.common.notChinese = function(_, C) {
	var A = hrm.common.getKeyCode(_);
	if (!hrm.common.keyCodeIsInput(A))
		return;
	if (!C.value)
		return;
	var B = C.value;
	for ( var $ = 0; $ < B.length; $++)
		if (B.charAt($).charCodeAt(0) > 255) {
			hrm.common.setHistoryValue(C.id, C.value.substring(0, $));
			C.value = hrm.common.getHistoryValue(C.id);
			return
		}
	hrm.common.setHistoryValue(C.id, C.value)
};
hrm.common.checkEmail = function(_) {
	var $ = _.value;
	_.style.color = "black";
	if ($ != "" && _.type == "text")
		if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test($.trim()))) {
			_.style.color = "red";
			window.setTimeout("$('#" + _.id + "').focus()", 0);
			return false
		} else {
			_.style.color = "black";
			return true
		}
	return false
};
hrm.common.checkPhone = function(A) {
	var $ = hrm.common.getKeyCode(event);
	if (!($ == 8 || $ == 9 || $ == 46 || $ == 45 || $ >= 48 && $ <= 57))
		if (hrm.common.navigatorIsIE())
			event.returnValue = false;
		else
			event.preventDefault();
	var _ = A.value;
	if (_ != "" && A.type == "text")
		if (!(/^[0|1](\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})(-(\d){3,4})?$/.test(_
				.trim()))
				&& !(/^[1-9]{1,3}(\d){8,9}$/.test(_.trim()))) {
			A.style.color = "red";
			window.setTimeout("$('#" + A.id + "').focus()", 0)
		} else
			A.style.color = "black";
	if (_.length == 0)
		A.style.color = "black"
};
hrm.common.checkZip = function(_) {
	var $ = _.value;
	if ($ != "" && _.type == "text")
		if (!(/^[1-9]\d{4,5}$/.test($))) {
			_.style.color = "red";
			window.setTimeout("$('#" + _.id + "').focus()", 0);
			return false
		} else {
			_.style.color = "black";
			return true
		}
	return false
};
hrm.common.checkIdentify = function(B, D) {
	var _ = document.getElementById(B), $ = document.getElementById(D);
	if (_ == null || $ == null)
		return;
	var B = _.value, D = $.value;
	if (D != null && D != "" && D.length > 0)
		switch (B) {
		case "0":
			var C = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/, A = /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}(\d{1}|[xX])$/;
			if (!C.exec(D) && !A.exec(D)) {
				$.style.color = "red";
				alert("\u8eab\u4efd\u8bc1\u683c\u5f0f\u9519\u8bef\uff01")
			} else
				$.style.color = "black";
			break;
		default:
			$.style.color = "black";
			break
		}
	else
		$.style.color = "black"
};
hrm.common.checkAllByName = function($, A) {
	var B = document.getElementsByName($);
	if (B.length > 0)
		if (document.getElementById(A).checked) {
			for ( var _ = 0; _ < B.length; _++)
				B[_].checked = true
		} else
			for (_ = 0; _ < B.length; _++)
				B[_].checked = false
};
hrm.common.getCheckboxByName = function($, A) {
	var D = document.getElementsByName($), B = "";
	for ( var _ = 0; _ < D.length; _++)
		if (D[_].checked && D[_].checked == true)
			if (!A)
				B += "'" + D[_].value + "',";
			else
				B += D[_].value + ",";
	var C = B.length;
	if (C > 0)
		B = B.substring(0, C - 1);
	return B
};
hrm.common.checkPassword = function($) {
	if (/^((\w)*([!@#$%^&*()-+=_])*){4,32}$/.test($.value))
		return true;
	alert("\u5bc6\u7801\u957f\u5ea6\u4e3a4-32\u4f4d\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u3001!@#$%^&*()-+=_,\u6216\u8005\u662f\u5176\u7ec4\u5408\uff0c\u8bf7\u6ce8\u610f\u5927\u5c0f\u5199\u53ca\u4e2d\u82f1\u6587\u72b6\u6001\uff01");
	$.value = "";
	return false
};
hrm.common.appendEnd = function(B, A) {
	var _ = $("#" + B).next().get(0);
	if (_ != undefined && _.nodeName == "SPAN")
		_.innerHTML = A;
	else
		$("#" + B).after("<span class=errorMessage>" + A + "</span>")
};
hrm.common.isNull = function($) {
	if (typeof ($) == "undefined" || $ == null)
		return true;
	if (typeof $ == "string")
		return $.trim() == "";
	return false
};
hrm.common.checkIP = function($) {
	var D = $.split("-"), B = "\u60a8\u8f93\u5165\u7684\u662f\u4e00\u4e2a\u975e\u6cd5\u7684IP\u5730\u5740\u6bb5\uff01\nIP\u6bb5\u4e3a\uff1a:xxx.xxx.xxx.xxx\uff08xxx\u4e3a0-255)\u6216 xxx.xxx.xxx.*\uff08xxx\u4e3a0-255 )\uff01";
	if (D.length == 1) {
		var I = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5]|[\s\S]*?)$/, J = $
				.match(I);
		if (J == null) {
			alert(B);
			return false
		} else
			return true
	}
	var _ = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/, F = D[0]
			.match(_), C = D[1].match(_), K = "\u60a8\u8f93\u5165\u7684\u662f\u4e00\u4e2a\u975e\u6cd5\u7684IP\u5730\u5740\u533a\u95f4\uff01";
	if (F == null || C == null) {
		alert(K);
		return false
	} else {
		var L = D[0].split("."), G = D[1].split("."), H, A;
		for ( var E = 0; E < L.length; E++) {
			if (L[E].length == 1)
				L[E] = "00" + L[E];
			else if (L[E].length == 2)
				L[E] = "0" + L[E];
			H += L[E]
		}
		for (E = 0; E < G.length; E++) {
			if (G[E].length == 1)
				G[E] = "00" + G[E];
			else if (G[E].length == 2)
				G[E] = "0" + G[E];
			A += G[E]
		}
		if (H > A) {
			alert(K);
			return false
		}
		return true
	}
};
hrm.common.getPoint = function(B) {
	var A = B.offsetLeft, $ = B.offsetTop;
	while (B = B.offsetParent) {
		A += B.offsetLeft;
		$ += B.offsetTop
	}
	var _ = window.screen.height;
	return {
		"x" :A,
		"y" :$
	}
};
hrm.common.getRelativePoint = function(D) {
	var C = D.parentNode, B = D.offsetLeft, A = D.offsetTop;
	while (D = D.offsetParent) {
		B += D.offsetLeft;
		A += D.offsetTop
	}
	while (C != null) {
		if (C.tagName == "DIV" && C.id.indexOf("dlg") == 0) {
			var _ = C.offsetLeft, $ = C.offsetTop;
			while (C = C.offsetParent) {
				_ += C.offsetLeft;
				$ += C.offsetTop
			}
			return {
				"x" :B - _ - 18,
				"y" :A - $ + 51
			}
		}
		C = C.parentNode
	}
	return {
		"x" :B,
		"y" :A + 20
	}
};
hrm.common.insteadForA = function($) {
	if (!$)
		return [];
	if ($.toArray)
		return $.toArray();
	else {
		var B = [];
		for ( var _ = 0, A = $.length; _ < A; _++)
			B.push($[_]);
		return B
	}
};
hrm.common.getCurrentDate = function() {
	var $ = new Date();
	with ($) {
		var year = getFullYear(), month = getMonth() + 1, day = getDate()
	}
	if (month < 10)
		month = "0" + month;
	if (day < 10)
		day = "0" + day;
	return year + "-" + month + "-" + day
};
hrm.common.randomStr = function(D, A, E, _) {
	var B = new Array(), C, $;
	B[0] = "";
	B[1] = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";
	B[2] = "a b c d e f g h i j k l m n o p q r s t u v w x y z";
	B[3] = "0 1 2 3 4 5 6 7 8 9";
	if (!A && !E && !_) {
		A = true;
		E = true;
		_ = true
	}
	if (A)
		B[0] += B[1];
	if (E)
		B[0] += " " + B[2];
	if (_)
		B[0] += " " + B[3];
	B[0] = B[0].split(" ");
	C = "";
	for ($ = 0; $ < D; $++)
		C += B[0][Math.round(Math.random() * (B[0].length - 1))];
	return (C)
};
hrm.common.convertStrToDate = function($) {
	var _ = /^(\d{4})-(\d{2})-(\d{2})$/;
	if (!_.test($))
		return null;
	return new Date($.replace(_, "$1/$2/$3"))
};
hrm.common.convertStrToDateAndTime = function($) {
	var _ = /^(\d{4})-(\d{2})-(\d{2}) (\d{2})\:(\d{2})$/;
	if (!_.test($))
		return null;
	return new Date($.replace(_, "$1/$2/$3 $4:$5"))
};
hrm.common.checkY_M = function(C, A) {
	var _ = C.value, $ = new Date(), B = $.toFormatString("yyyy-MM");
	if (!hrm.common.isYM(_)) {
		alert("\u67e5\u8be2\u65e5\u671f "
				+ _
				+ "\u8f93\u5165\u4e0d\u6b63\u786e\uff0c\u683c\u5f0f\u5e94\u5982"
				+ B + "\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff01");
		C.style.border = "1px #FF0000 solid";
		C.focus();
		return null
	}
	C.style.border = "1px #6BB5DA solid";
	C.value = monthAddDiff(_, "-", A);
	return C.value
};
hrm.common.checkYM = function(C, A) {
	var _ = C.value, $ = new Date(), B = $.toFormatString("yyyyMM");
	if (!hrm.common.isYM(_)) {
		alert("\u67e5\u8be2\u65e5\u671f "
				+ _
				+ "\u8f93\u5165\u4e0d\u6b63\u786e\uff0c\u683c\u5f0f\u5e94\u5982"
				+ B + "\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff01");
		C.style.border = "1px #FF0000 solid";
		C.focus();
		return null
	}
	C.style.border = "1px #6BB5DA solid";
	C.value = monthAddDiff(_, "", A);
	return C.value
};
hrm.common.changeMonth = function(C, _) {
	var B = hrm.common.checkY_M(document.getElementById("yearMonth"), C);
	if (B == null)
		return;
	$("#up").attr("disabled", true);
	$("#down").attr("disabled", true);
	var A = document.getElementById("searchOrExport");
	if (A != null)
		A.value = "";
	document.getElementById(_).submit()
};
function monthAddDiff(D, B, C) {
	var _, $;
	if (B == "") {
		_ = D.substring(0, 4) * 1;
		$ = D.substring(4, 6) * 1
	} else {
		dates = D.split(B);
		_ = dates[0] * 1;
		$ = dates[1] * 1
	}
	if (!isNaN(C))
		$ = $ + C;
	if ($ <= 0) {
		_ = _ - 1;
		$ = $ + 12
	} else if ($ > 12) {
		_ = _ + 1;
		$ = $ - 12
	}
	var A = $;
	if ($ < 10)
		A = "0" + $;
	return _ + B + A
}
hrm.common.checkYMAndSubmit = function(_, $) {
	if (hrm.common.checkY_M(_) == null)
		return;
	document.getElementById($).submit()
};
hrm.common.createAutoNoOnKeyUp = function(C, F, _, B, E) {
	if (F.readOnly)
		return;
	var D = hrm.common.getKeyCode(C), A = model.simple.getElement(_);
	if (!hrm.common.keyCodeIsInput(D) && D != 8) {
		if (D == 40)
			if (F.value.length > 0) {
				F.value = A.innerHTML;
				A.style.display = "none"
			}
		return
	}
	hrm.common.notChinese(C, F);
	DwrForAutoNO.getAutoNo(B, F.value, E, $);
	function $(B) {
		var $ = model.simple.getElementPosition(F), _ = model.simple
				.getElement(A);
		if (B != null && B != "") {
			_.style.top = $.top;
			_.style.left = $.right;
			_.style.display = "block";
			_.innerHTML = B;
			_.onclick = function() {
				F.value = B;
				_.style.display = "none"
			};
			_.onmouseout = function() {
				_.style.display = "none"
			}
		} else
			_.style.display = "none"
	}
}